package com.qf.ex;


import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/ex")
public class TestController {

    @RequestMapping("/test2")
    public String test2(String name) {

        if (null == name || "".equals(name)) {
//            throw new Exception("参数name不能为空");
            throw new RuntimeException("参数name不能为空");
        }

        return "hi";
    }

    @RequestMapping("/test1")
    public String test1() {
        int a = 1 / 0;

        return "hi";
    }
}
